/**
 * Created by Administrator on 2018/4/10.
 */
export default{  
	install(Vue,options){  
		Vue.prototype.url= "http://20515li082.iok.la:37769"   //可以自定义变量    
		Vue.prototype.setCookie = function (cname, cvalue, exdays) { ////设置cookie 
	        var d = new Date();
	        d.setTime(d.getTime() + (exdays * 12 * 60 * 60));
	        var expires = "expires=" + d.toUTCString();
	        console.info(cname + "=" + cvalue + "; " + expires);
	        document.cookie = cname + "=" + cvalue + "; " + expires;
		}

		Vue.prototype.getCookie = function (cname) { //获取cookie 
	        var name = cname + "=";
	        var ca = document.cookie.split(';');
	        for (var i = 0; i < ca.length; i++) {
	            var c = ca[i];
	            while (c.charAt(0) == ' ') c = c.substring(1);
	            if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
	        }
	        return "";
		}

		Vue.prototype.clearCookie = function (cname) { //清除cookie 
			this.setCookie("userinfo", "", -1);
		}

	}
}